<?php


/**
 * Base class that represents a query for the 'employee_evaluation_values' table.
 *
 *
 *
 * @method EmpevalEmployeeEvaluationValuesQuery orderByBonusGoalsFormId($order = Criteria::ASC) Order by the bonus_goals_form_id column
 * @method EmpevalEmployeeEvaluationValuesQuery orderByBehavioralIndicatorId($order = Criteria::ASC) Order by the behavioral_indicator_id column
 * @method EmpevalEmployeeEvaluationValuesQuery orderByEvaluationId($order = Criteria::ASC) Order by the evaluation_id column
 * @method EmpevalEmployeeEvaluationValuesQuery orderByComment($order = Criteria::ASC) Order by the comment column
 * @method EmpevalEmployeeEvaluationValuesQuery orderByActive($order = Criteria::ASC) Order by the active column
 * @method EmpevalEmployeeEvaluationValuesQuery orderByLastModified($order = Criteria::ASC) Order by the last_modified column
 * @method EmpevalEmployeeEvaluationValuesQuery orderByCreated($order = Criteria::ASC) Order by the created column
 *
 * @method EmpevalEmployeeEvaluationValuesQuery groupByBonusGoalsFormId() Group by the bonus_goals_form_id column
 * @method EmpevalEmployeeEvaluationValuesQuery groupByBehavioralIndicatorId() Group by the behavioral_indicator_id column
 * @method EmpevalEmployeeEvaluationValuesQuery groupByEvaluationId() Group by the evaluation_id column
 * @method EmpevalEmployeeEvaluationValuesQuery groupByComment() Group by the comment column
 * @method EmpevalEmployeeEvaluationValuesQuery groupByActive() Group by the active column
 * @method EmpevalEmployeeEvaluationValuesQuery groupByLastModified() Group by the last_modified column
 * @method EmpevalEmployeeEvaluationValuesQuery groupByCreated() Group by the created column
 *
 * @method EmpevalEmployeeEvaluationValuesQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
 * @method EmpevalEmployeeEvaluationValuesQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
 * @method EmpevalEmployeeEvaluationValuesQuery innerJoin($relation) Adds a INNER JOIN clause to the query
 *
 * @method EmpevalEmployeeEvaluationValuesQuery leftJoinBehavioralIndicators($relationAlias = null) Adds a LEFT JOIN clause to the query using the BehavioralIndicators relation
 * @method EmpevalEmployeeEvaluationValuesQuery rightJoinBehavioralIndicators($relationAlias = null) Adds a RIGHT JOIN clause to the query using the BehavioralIndicators relation
 * @method EmpevalEmployeeEvaluationValuesQuery innerJoinBehavioralIndicators($relationAlias = null) Adds a INNER JOIN clause to the query using the BehavioralIndicators relation
 *
 * @method EmpevalEmployeeEvaluationValuesQuery leftJoinEmployeeEvaluations($relationAlias = null) Adds a LEFT JOIN clause to the query using the EmployeeEvaluations relation
 * @method EmpevalEmployeeEvaluationValuesQuery rightJoinEmployeeEvaluations($relationAlias = null) Adds a RIGHT JOIN clause to the query using the EmployeeEvaluations relation
 * @method EmpevalEmployeeEvaluationValuesQuery innerJoinEmployeeEvaluations($relationAlias = null) Adds a INNER JOIN clause to the query using the EmployeeEvaluations relation
 *
 * @method EmpevalEmployeeEvaluationValuesQuery leftJoinEvaluations($relationAlias = null) Adds a LEFT JOIN clause to the query using the Evaluations relation
 * @method EmpevalEmployeeEvaluationValuesQuery rightJoinEvaluations($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Evaluations relation
 * @method EmpevalEmployeeEvaluationValuesQuery innerJoinEvaluations($relationAlias = null) Adds a INNER JOIN clause to the query using the Evaluations relation
 *
 * @method EmpevalEmployeeEvaluationValues findOne(PropelPDO $con = null) Return the first EmpevalEmployeeEvaluationValues matching the query
 * @method EmpevalEmployeeEvaluationValues findOneOrCreate(PropelPDO $con = null) Return the first EmpevalEmployeeEvaluationValues matching the query, or a new EmpevalEmployeeEvaluationValues object populated from the query conditions when no match is found
 *
 * @method EmpevalEmployeeEvaluationValues findOneByBonusGoalsFormId(int $bonus_goals_form_id) Return the first EmpevalEmployeeEvaluationValues filtered by the bonus_goals_form_id column
 * @method EmpevalEmployeeEvaluationValues findOneByBehavioralIndicatorId(int $behavioral_indicator_id) Return the first EmpevalEmployeeEvaluationValues filtered by the behavioral_indicator_id column
 * @method EmpevalEmployeeEvaluationValues findOneByEvaluationId(int $evaluation_id) Return the first EmpevalEmployeeEvaluationValues filtered by the evaluation_id column
 * @method EmpevalEmployeeEvaluationValues findOneByComment(string $comment) Return the first EmpevalEmployeeEvaluationValues filtered by the comment column
 * @method EmpevalEmployeeEvaluationValues findOneByActive(boolean $active) Return the first EmpevalEmployeeEvaluationValues filtered by the active column
 * @method EmpevalEmployeeEvaluationValues findOneByLastModified(string $last_modified) Return the first EmpevalEmployeeEvaluationValues filtered by the last_modified column
 * @method EmpevalEmployeeEvaluationValues findOneByCreated(string $created) Return the first EmpevalEmployeeEvaluationValues filtered by the created column
 *
 * @method array findByBonusGoalsFormId(int $bonus_goals_form_id) Return EmpevalEmployeeEvaluationValues objects filtered by the bonus_goals_form_id column
 * @method array findByBehavioralIndicatorId(int $behavioral_indicator_id) Return EmpevalEmployeeEvaluationValues objects filtered by the behavioral_indicator_id column
 * @method array findByEvaluationId(int $evaluation_id) Return EmpevalEmployeeEvaluationValues objects filtered by the evaluation_id column
 * @method array findByComment(string $comment) Return EmpevalEmployeeEvaluationValues objects filtered by the comment column
 * @method array findByActive(boolean $active) Return EmpevalEmployeeEvaluationValues objects filtered by the active column
 * @method array findByLastModified(string $last_modified) Return EmpevalEmployeeEvaluationValues objects filtered by the last_modified column
 * @method array findByCreated(string $created) Return EmpevalEmployeeEvaluationValues objects filtered by the created column
 *
 * @package    propel.generator.empeval.om
 */
abstract class EmpevalBaseEmployeeEvaluationValuesQuery extends ModelCriteria
{
    /**
     * Initializes internal state of EmpevalBaseEmployeeEvaluationValuesQuery object.
     *
     * @param     string $dbName The dabase name
     * @param     string $modelName The phpName of a model, e.g. 'Book'
     * @param     string $modelAlias The alias for the model in this query, e.g. 'b'
     */
    public function __construct($dbName = 'vgp_empeval', $modelName = 'EmpevalEmployeeEvaluationValues', $modelAlias = null)
    {
        parent::__construct($dbName, $modelName, $modelAlias);
    }

    /**
     * Returns a new EmpevalEmployeeEvaluationValuesQuery object.
     *
     * @param     string $modelAlias The alias of a model in the query
     * @param     EmpevalEmployeeEvaluationValuesQuery|Criteria $criteria Optional Criteria to build the query from
     *
     * @return EmpevalEmployeeEvaluationValuesQuery
     */
    public static function create($modelAlias = null, $criteria = null)
    {
        if ($criteria instanceof EmpevalEmployeeEvaluationValuesQuery) {
            return $criteria;
        }
        $query = new EmpevalEmployeeEvaluationValuesQuery();
        if (null !== $modelAlias) {
            $query->setModelAlias($modelAlias);
        }
        if ($criteria instanceof Criteria) {
            $query->mergeWith($criteria);
        }

        return $query;
    }

    /**
     * Find object by primary key.
     * Propel uses the instance pool to skip the database if the object exists.
     * Go fast if the query is untouched.
     *
     * <code>
     * $obj = $c->findPk(array(12, 34), $con);
     * </code>
     *
     * @param array $key Primary key to use for the query
                         A Primary key composition: [$bonus_goals_form_id, $behavioral_indicator_id]
     * @param     PropelPDO $con an optional connection object
     *
     * @return   EmpevalEmployeeEvaluationValues|EmpevalEmployeeEvaluationValues[]|mixed the result, formatted by the current formatter
     */
    public function findPk($key, $con = null)
    {
        if ($key === null) {
            return null;
        }
        if ((null !== ($obj = EmpevalEmployeeEvaluationValuesPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
            // the object is alredy in the instance pool
            return $obj;
        }
        if ($con === null) {
            $con = Propel::getConnection(EmpevalEmployeeEvaluationValuesPeer::DATABASE_NAME, Propel::CONNECTION_READ);
        }
        $this->basePreSelect($con);
        if ($this->formatter || $this->modelAlias || $this->with || $this->select
         || $this->selectColumns || $this->asColumns || $this->selectModifiers
         || $this->map || $this->having || $this->joins) {
            return $this->findPkComplex($key, $con);
        } else {
            return $this->findPkSimple($key, $con);
        }
    }

    /**
     * Find object by primary key using raw SQL to go fast.
     * Bypass doSelect() and the object formatter by using generated code.
     *
     * @param     mixed $key Primary key to use for the query
     * @param     PropelPDO $con A connection object
     *
     * @return   EmpevalEmployeeEvaluationValues A model object, or null if the key is not found
     * @throws   PropelException
     */
    protected function findPkSimple($key, $con)
    {
        $sql = 'SELECT BONUS_GOALS_FORM_ID, BEHAVIORAL_INDICATOR_ID, EVALUATION_ID, COMMENT, ACTIVE, LAST_MODIFIED, CREATED FROM employee_evaluation_values WHERE BONUS_GOALS_FORM_ID = :p0 AND BEHAVIORAL_INDICATOR_ID = :p1';
        try {
            $stmt = $con->prepare($sql);
            $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
            $stmt->bindValue(':p1', $key[1], PDO::PARAM_INT);
            $stmt->execute();
        } catch (Exception $e) {
            Propel::log($e->getMessage(), Propel::LOG_ERR);
            throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
        }
        $obj = null;
        if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
            $obj = new EmpevalEmployeeEvaluationValues();
            $obj->hydrate($row);
            EmpevalEmployeeEvaluationValuesPeer::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
        }
        $stmt->closeCursor();

        return $obj;
    }

    /**
     * Find object by primary key.
     *
     * @param     mixed $key Primary key to use for the query
     * @param     PropelPDO $con A connection object
     *
     * @return EmpevalEmployeeEvaluationValues|EmpevalEmployeeEvaluationValues[]|mixed the result, formatted by the current formatter
     */
    protected function findPkComplex($key, $con)
    {
        // As the query uses a PK condition, no limit(1) is necessary.
        $criteria = $this->isKeepQuery() ? clone $this : $this;
        $stmt = $criteria
            ->filterByPrimaryKey($key)
            ->doSelect($con);

        return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
    }

    /**
     * Find objects by primary key
     * <code>
     * $objs = $c->findPks(array(array(12, 56), array(832, 123), array(123, 456)), $con);
     * </code>
     * @param     array $keys Primary keys to use for the query
     * @param     PropelPDO $con an optional connection object
     *
     * @return PropelObjectCollection|EmpevalEmployeeEvaluationValues[]|mixed the list of results, formatted by the current formatter
     */
    public function findPks($keys, $con = null)
    {
        if ($con === null) {
            $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
        }
        $this->basePreSelect($con);
        $criteria = $this->isKeepQuery() ? clone $this : $this;
        $stmt = $criteria
            ->filterByPrimaryKeys($keys)
            ->doSelect($con);

        return $criteria->getFormatter()->init($criteria)->format($stmt);
    }

    /**
     * Filter the query by primary key
     *
     * @param     mixed $key Primary key to use for the query
     *
     * @return EmpevalEmployeeEvaluationValuesQuery The current query, for fluid interface
     */
    public function filterByPrimaryKey($key)
    {
        $this->addUsingAlias(EmpevalEmployeeEvaluationValuesPeer::BONUS_GOALS_FORM_ID, $key[0], Criteria::EQUAL);
        $this->addUsingAlias(EmpevalEmployeeEvaluationValuesPeer::BEHAVIORAL_INDICATOR_ID, $key[1], Criteria::EQUAL);

        return $this;
    }

    /**
     * Filter the query by a list of primary keys
     *
     * @param     array $keys The list of primary key to use for the query
     *
     * @return EmpevalEmployeeEvaluationValuesQuery The current query, for fluid interface
     */
    public function filterByPrimaryKeys($keys)
    {
        if (empty($keys)) {
            return $this->add(null, '1<>1', Criteria::CUSTOM);
        }
        foreach ($keys as $key) {
            $cton0 = $this->getNewCriterion(EmpevalEmployeeEvaluationValuesPeer::BONUS_GOALS_FORM_ID, $key[0], Criteria::EQUAL);
            $cton1 = $this->getNewCriterion(EmpevalEmployeeEvaluationValuesPeer::BEHAVIORAL_INDICATOR_ID, $key[1], Criteria::EQUAL);
            $cton0->addAnd($cton1);
            $this->addOr($cton0);
        }

        return $this;
    }

    /**
     * Filter the query on the bonus_goals_form_id column
     *
     * Example usage:
     * <code>
     * $query->filterByBonusGoalsFormId(1234); // WHERE bonus_goals_form_id = 1234
     * $query->filterByBonusGoalsFormId(array(12, 34)); // WHERE bonus_goals_form_id IN (12, 34)
     * $query->filterByBonusGoalsFormId(array('min' => 12)); // WHERE bonus_goals_form_id > 12
     * </code>
     *
     * @see       filterByEmployeeEvaluations()
     *
     * @param     mixed $bonusGoalsFormId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalEmployeeEvaluationValuesQuery The current query, for fluid interface
     */
    public function filterByBonusGoalsFormId($bonusGoalsFormId = null, $comparison = null)
    {
        if (is_array($bonusGoalsFormId) && null === $comparison) {
            $comparison = Criteria::IN;
        }

        return $this->addUsingAlias(EmpevalEmployeeEvaluationValuesPeer::BONUS_GOALS_FORM_ID, $bonusGoalsFormId, $comparison);
    }

    /**
     * Filter the query on the behavioral_indicator_id column
     *
     * Example usage:
     * <code>
     * $query->filterByBehavioralIndicatorId(1234); // WHERE behavioral_indicator_id = 1234
     * $query->filterByBehavioralIndicatorId(array(12, 34)); // WHERE behavioral_indicator_id IN (12, 34)
     * $query->filterByBehavioralIndicatorId(array('min' => 12)); // WHERE behavioral_indicator_id > 12
     * </code>
     *
     * @see       filterByBehavioralIndicators()
     *
     * @param     mixed $behavioralIndicatorId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalEmployeeEvaluationValuesQuery The current query, for fluid interface
     */
    public function filterByBehavioralIndicatorId($behavioralIndicatorId = null, $comparison = null)
    {
        if (is_array($behavioralIndicatorId) && null === $comparison) {
            $comparison = Criteria::IN;
        }

        return $this->addUsingAlias(EmpevalEmployeeEvaluationValuesPeer::BEHAVIORAL_INDICATOR_ID, $behavioralIndicatorId, $comparison);
    }

    /**
     * Filter the query on the evaluation_id column
     *
     * Example usage:
     * <code>
     * $query->filterByEvaluationId(1234); // WHERE evaluation_id = 1234
     * $query->filterByEvaluationId(array(12, 34)); // WHERE evaluation_id IN (12, 34)
     * $query->filterByEvaluationId(array('min' => 12)); // WHERE evaluation_id > 12
     * </code>
     *
     * @see       filterByEvaluations()
     *
     * @param     mixed $evaluationId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalEmployeeEvaluationValuesQuery The current query, for fluid interface
     */
    public function filterByEvaluationId($evaluationId = null, $comparison = null)
    {
        if (is_array($evaluationId)) {
            $useMinMax = false;
            if (isset($evaluationId['min'])) {
                $this->addUsingAlias(EmpevalEmployeeEvaluationValuesPeer::EVALUATION_ID, $evaluationId['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($evaluationId['max'])) {
                $this->addUsingAlias(EmpevalEmployeeEvaluationValuesPeer::EVALUATION_ID, $evaluationId['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalEmployeeEvaluationValuesPeer::EVALUATION_ID, $evaluationId, $comparison);
    }

    /**
     * Filter the query on the comment column
     *
     * Example usage:
     * <code>
     * $query->filterByComment('fooValue');   // WHERE comment = 'fooValue'
     * $query->filterByComment('%fooValue%'); // WHERE comment LIKE '%fooValue%'
     * </code>
     *
     * @param     string $comment The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalEmployeeEvaluationValuesQuery The current query, for fluid interface
     */
    public function filterByComment($comment = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($comment)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $comment)) {
                $comment = str_replace('*', '%', $comment);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalEmployeeEvaluationValuesPeer::COMMENT, $comment, $comparison);
    }

    /**
     * Filter the query on the active column
     *
     * Example usage:
     * <code>
     * $query->filterByActive(true); // WHERE active = true
     * $query->filterByActive('yes'); // WHERE active = true
     * </code>
     *
     * @param     boolean|string $active The value to use as filter.
     *              Non-boolean arguments are converted using the following rules:
     *                * 1, '1', 'true',  'on',  and 'yes' are converted to boolean true
     *                * 0, '0', 'false', 'off', and 'no'  are converted to boolean false
     *              Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalEmployeeEvaluationValuesQuery The current query, for fluid interface
     */
    public function filterByActive($active = null, $comparison = null)
    {
        if (is_string($active)) {
            $active = in_array(strtolower($active), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
        }

        return $this->addUsingAlias(EmpevalEmployeeEvaluationValuesPeer::ACTIVE, $active, $comparison);
    }

    /**
     * Filter the query on the last_modified column
     *
     * Example usage:
     * <code>
     * $query->filterByLastModified('2011-03-14'); // WHERE last_modified = '2011-03-14'
     * $query->filterByLastModified('now'); // WHERE last_modified = '2011-03-14'
     * $query->filterByLastModified(array('max' => 'yesterday')); // WHERE last_modified > '2011-03-13'
     * </code>
     *
     * @param     mixed $lastModified The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalEmployeeEvaluationValuesQuery The current query, for fluid interface
     */
    public function filterByLastModified($lastModified = null, $comparison = null)
    {
        if (is_array($lastModified)) {
            $useMinMax = false;
            if (isset($lastModified['min'])) {
                $this->addUsingAlias(EmpevalEmployeeEvaluationValuesPeer::LAST_MODIFIED, $lastModified['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($lastModified['max'])) {
                $this->addUsingAlias(EmpevalEmployeeEvaluationValuesPeer::LAST_MODIFIED, $lastModified['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalEmployeeEvaluationValuesPeer::LAST_MODIFIED, $lastModified, $comparison);
    }

    /**
     * Filter the query on the created column
     *
     * Example usage:
     * <code>
     * $query->filterByCreated('2011-03-14'); // WHERE created = '2011-03-14'
     * $query->filterByCreated('now'); // WHERE created = '2011-03-14'
     * $query->filterByCreated(array('max' => 'yesterday')); // WHERE created > '2011-03-13'
     * </code>
     *
     * @param     mixed $created The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalEmployeeEvaluationValuesQuery The current query, for fluid interface
     */
    public function filterByCreated($created = null, $comparison = null)
    {
        if (is_array($created)) {
            $useMinMax = false;
            if (isset($created['min'])) {
                $this->addUsingAlias(EmpevalEmployeeEvaluationValuesPeer::CREATED, $created['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($created['max'])) {
                $this->addUsingAlias(EmpevalEmployeeEvaluationValuesPeer::CREATED, $created['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalEmployeeEvaluationValuesPeer::CREATED, $created, $comparison);
    }

    /**
     * Filter the query by a related EmpevalBehavioralIndicators object
     *
     * @param   EmpevalBehavioralIndicators|PropelObjectCollection $behavioralIndicators The related object(s) to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalEmployeeEvaluationValuesQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByBehavioralIndicators($behavioralIndicators, $comparison = null)
    {
        if ($behavioralIndicators instanceof EmpevalBehavioralIndicators) {
            return $this
                ->addUsingAlias(EmpevalEmployeeEvaluationValuesPeer::BEHAVIORAL_INDICATOR_ID, $behavioralIndicators->getId(), $comparison);
        } elseif ($behavioralIndicators instanceof PropelObjectCollection) {
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }

            return $this
                ->addUsingAlias(EmpevalEmployeeEvaluationValuesPeer::BEHAVIORAL_INDICATOR_ID, $behavioralIndicators->toKeyValue('PrimaryKey', 'Id'), $comparison);
        } else {
            throw new PropelException('filterByBehavioralIndicators() only accepts arguments of type EmpevalBehavioralIndicators or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the BehavioralIndicators relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalEmployeeEvaluationValuesQuery The current query, for fluid interface
     */
    public function joinBehavioralIndicators($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('BehavioralIndicators');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'BehavioralIndicators');
        }

        return $this;
    }

    /**
     * Use the BehavioralIndicators relation BehavioralIndicators object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalBehavioralIndicatorsQuery A secondary query class using the current class as primary query
     */
    public function useBehavioralIndicatorsQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinBehavioralIndicators($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'BehavioralIndicators', 'EmpevalBehavioralIndicatorsQuery');
    }

    /**
     * Filter the query by a related EmpevalEmployeeEvaluations object
     *
     * @param   EmpevalEmployeeEvaluations|PropelObjectCollection $employeeEvaluations The related object(s) to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalEmployeeEvaluationValuesQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByEmployeeEvaluations($employeeEvaluations, $comparison = null)
    {
        if ($employeeEvaluations instanceof EmpevalEmployeeEvaluations) {
            return $this
                ->addUsingAlias(EmpevalEmployeeEvaluationValuesPeer::BONUS_GOALS_FORM_ID, $employeeEvaluations->getBonusGoalsFormId(), $comparison);
        } elseif ($employeeEvaluations instanceof PropelObjectCollection) {
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }

            return $this
                ->addUsingAlias(EmpevalEmployeeEvaluationValuesPeer::BONUS_GOALS_FORM_ID, $employeeEvaluations->toKeyValue('PrimaryKey', 'BonusGoalsFormId'), $comparison);
        } else {
            throw new PropelException('filterByEmployeeEvaluations() only accepts arguments of type EmpevalEmployeeEvaluations or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the EmployeeEvaluations relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalEmployeeEvaluationValuesQuery The current query, for fluid interface
     */
    public function joinEmployeeEvaluations($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('EmployeeEvaluations');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'EmployeeEvaluations');
        }

        return $this;
    }

    /**
     * Use the EmployeeEvaluations relation EmployeeEvaluations object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalEmployeeEvaluationsQuery A secondary query class using the current class as primary query
     */
    public function useEmployeeEvaluationsQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinEmployeeEvaluations($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'EmployeeEvaluations', 'EmpevalEmployeeEvaluationsQuery');
    }

    /**
     * Filter the query by a related EmpevalEvaluations object
     *
     * @param   EmpevalEvaluations|PropelObjectCollection $evaluations The related object(s) to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalEmployeeEvaluationValuesQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByEvaluations($evaluations, $comparison = null)
    {
        if ($evaluations instanceof EmpevalEvaluations) {
            return $this
                ->addUsingAlias(EmpevalEmployeeEvaluationValuesPeer::EVALUATION_ID, $evaluations->getId(), $comparison);
        } elseif ($evaluations instanceof PropelObjectCollection) {
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }

            return $this
                ->addUsingAlias(EmpevalEmployeeEvaluationValuesPeer::EVALUATION_ID, $evaluations->toKeyValue('PrimaryKey', 'Id'), $comparison);
        } else {
            throw new PropelException('filterByEvaluations() only accepts arguments of type EmpevalEvaluations or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the Evaluations relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalEmployeeEvaluationValuesQuery The current query, for fluid interface
     */
    public function joinEvaluations($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('Evaluations');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'Evaluations');
        }

        return $this;
    }

    /**
     * Use the Evaluations relation Evaluations object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalEvaluationsQuery A secondary query class using the current class as primary query
     */
    public function useEvaluationsQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        return $this
            ->joinEvaluations($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'Evaluations', 'EmpevalEvaluationsQuery');
    }

    /**
     * Exclude object from result
     *
     * @param   EmpevalEmployeeEvaluationValues $employeeEvaluationValues Object to remove from the list of results
     *
     * @return EmpevalEmployeeEvaluationValuesQuery The current query, for fluid interface
     */
    public function prune($employeeEvaluationValues = null)
    {
        if ($employeeEvaluationValues) {
            $this->addCond('pruneCond0', $this->getAliasedColName(EmpevalEmployeeEvaluationValuesPeer::BONUS_GOALS_FORM_ID), $employeeEvaluationValues->getBonusGoalsFormId(), Criteria::NOT_EQUAL);
            $this->addCond('pruneCond1', $this->getAliasedColName(EmpevalEmployeeEvaluationValuesPeer::BEHAVIORAL_INDICATOR_ID), $employeeEvaluationValues->getBehavioralIndicatorId(), Criteria::NOT_EQUAL);
            $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
        }

        return $this;
    }

}
